package cn.yi.boot.mq.rocketmq.service;

import cn.yi.boot.mq.rocketmq.properties.RocketMQPullProperties;
import com.alibaba.rocketmq.common.message.MessageExt;

import java.util.List;

public interface RocketMQPullService {

    /**
     * Pull方式获取MQ的消息队列
     */
    void pullMessageQueue(RocketMQPullProperties rocketMQProperties, MessageInterface messageInterface);

    @FunctionalInterface
    interface MessageInterface<T>{
        /**
         * 默认返回消息数据大小
         * @param messageExts
         * @return
         */
          T process(List<MessageExt> messageExts);
    }
}
